import java.util.Scanner;

public class everynumsum {
    public static int sum(int n){
        if(n < 10){
            return n;
        }
        return (n % 10) + sum(n / 10);
    }


    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入你要计算的数字：");
        int n = scan.nextInt();
        System.out.println(sum(n));
    }
}
